package Thread;

import java.util.concurrent.BlockingDeque;
import java.util.concurrent.LinkedBlockingDeque;

public class ThreadDemo15 {
    public static void main(String[] args) throws InterruptedException {
        BlockingDeque<String > queue = new LinkedBlockingDeque<>();
        queue.put("hello1");
        queue.put("hello2");
        queue.put("hello3");
        queue.put("hello4");
        queue.put("hello5");
        String s1;
        s1 = queue.take();
        System.out.println(s1);
        s1 = queue.take();
        System.out.println(s1);
        s1 = queue.take();
        System.out.println(s1);
        s1 = queue.take();
        System.out.println(s1);
        s1 = queue.take();
        System.out.println(s1);

    }
}
